package com.example.xxpk.controller.boxes;

import com.example.xxpk.common.result.R;
import com.example.xxpk.service.boxes.IBoxesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhangguihong
 * @since 2025-02-13
 */
@RestController
@RequestMapping("/boxes")
@RequiredArgsConstructor
@Api(tags="宝箱表")
public class BoxesController {

    private final IBoxesService boxesService;

    @PostMapping("/open")
    @ApiOperation("开启宝箱")
    public R openBoxex(Integer userId , Integer type) {
        if (type == 1){
            boxesService.openBox(userId,type);
        }
        return R.ok("开启成功");
    }



}
